Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- NAMED MODULE



  jsonSerialize() in extended class

Since PHP 5.4.0, there is a convenient interface JsonSerializable which can be used to indicate that a PHP object can be serialized to JSON object. It has only one method which should be implemented by any class which implements this interface. The method is named jsonSerialize(). It's really easy to serialize an object to JSON object. Here is one example: <?php class ArrayValue implements JsonSerializable { public function __construct(array $array) { $this->array = $array; ...

   JSON,jsonSerialize,Inheritance,extends     2014-07-26 05:54:00

  A mini guide to HTTP referer

In HTTP header, there is a field named Referer which is to provide the referrer of the current accessed page. In this post, we will introduce the usage of HTTP referer field. On the web, when a user visits a webpage, s/he must be from some place. This place is usually referred a s referer. This information is very important to some website operators and server owners as they want to know where they get the traffic from and this helps them provide better service for potential targeted users. In t...

   HTML,HTTP REFERER,REFERRERPOLICY     2019-06-29 02:23:25

  If we use programming language names as building names

Today I came across some interesting building names while wandering around technology park of Singapore. Most of these names are biotech related. They are Chromos,  Centros, Matrix, Genome, Proteos, Nanos, Helios, Neuros, Immunos, Synapse and Amnios. Chromos Centros Matrix Genome Proteos Nanos Helios Neuros Immunos Synapse Amnios I am wondering whether there are building which are named with programming language names. Do you see anyone of them anywhere?...

   Buidling name,Programming language     2013-08-16 06:02:26

  Chrome to provide native image lazyload support

Previously we have introduced how Medium achieved loading images lazily, basically what they did was using lots of HTML tags and CSSs to change the images at different stage. It needs lots of code to do this. With the high demand of this feature for resource consumption and performance consideration, Chrome is now working on a feature to provide native support for loading images/iframes lazily. This feature is named lazyload. lazyload will allow three values: auto: the default behavior of ...

   CHROME,LAZYLOAD,IMAGE,IFRAME     2018-09-22 23:04:35

  Tips for improving PHP efficiency

0. Using single quote to replace double quote to enclose string literal, this will be a bit faster. Because PHP engine will search variables in double quoted string. 1. If a method in class can be declared as static, then make it static, this will be 4 times faster. 2. $row["id"] is 7 times faster than $row[id] 3. echo is faster than print, and you should use multiple parameters instead of string concatenation, i.e use comma(,) instead of dot(.) to concatenate string. For example echo $str1,$str...

   PHP, efficiency, tips     2012-10-01 19:39:06

  Steve Ballmer will retire from Microsoft within one year

Microsoft today announced on its official website that CEO Steve Ballmer will retire from Microsoft with 12 months. But he will remain as the CEO until the successor is named. Steve Ballmer commented on his retirement as : There is never a perfect time for this type of transition, but now is the right time, We have embarked on a new strategy with a new organization and we have an amazing Senior Leadership Team. My original thoughts on timing would have had my retirement happen in the middle of...

   Microsoft,CEO,Retirement     2013-08-23 08:34:10

  The history of the name Google

Google now is known almost by everyone who has internet access. It's the most frequently accessed search engine around the world and it provides fast speed and high quality search results. While you are using Google, have you ever wondered how the name Google comes? According to Steven Levy, the author of the book In The Plex: How Google Thinks, Works, and Shapes Our Lives. The original name for the project was named BackRub and was coded by Sergey Brin. He was thinking that web pages made thei...

   GOOGLE,HISTORY,GOOGLE NAME,GOOGOL     2016-12-03 20:58:06

  In defence of Objective-C

An unashamed apologist’s perspective on the loveliest language i’ve worked with.I’ve worked with a lot of programming languages in my time. Not a huge number, mind you, but enough that i can say that i’m open minded and seasoned about it. And, as they say: ‘Don’t feed the trolls’ – well, i’m about to do exactly that: feed the trolls at work who love to rag on about how awful obj-c is! So here i go, foolishly treading where no sensible...

   Apple,Objective-C,Syntax,Defense,Memory management     2011-10-17 11:28:39

  JavaScript Is Not A Language

Recently people presented arguments for and against using CoffeeScript. I felt the argument against was pointless and obviously wrong, but I couldn't figure out why, and I thought the counterargument for was kind of toothless and irrelevant. I've figured out the real issue.The real argument for CoffeeScript is that JavaScript is not really a language.Years ago I read something which explained, in my opinion, why Lisp has never achieved the mainstream adoption its passionate advocates belie...

   JavaScript,Not a language,CoffeeScript,Model     2011-12-29 08:46:15

  String intern in Java

In Java, == is used to compare whether two objects have the same memory location, equals() is usually used to compare whether two objects have the same time and the same state.  When comparing two strings, normally we just want to know whether they have same content, so we can choose equals(). But since String comparison is so frequently needed, Java has worked on the String class to make == workable when comparing two String literals. The String class maintains a pool of emp...

   JAVA,STRING     2016-04-10 03:35:25